package com.atgugu.springcloud.controller;

import com.atgugu.springcloud.domain.CommonResult;
import com.atgugu.springcloud.domain.Order;
import com.atgugu.springcloud.service.OrderService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author ZhangXinWang
 * @date 2023/1/7 20:04
 */
@RestController
public class OrderController {

    @Resource
    private OrderService orderService;

    /**
     * test address:
     * http://localhost:2001/order/create?userId=1&productId=1&count=10&money=100
     */
    @GetMapping(value = "/order/create")
    public CommonResult create(Order order) {
        orderService.create(order);
        return new CommonResult(200, "订单穿件成功");
    }


}
